home *** CD-ROM | disk | FTP | other *** search
- Path: castle.nando.net!news
- From: actuary@nando.net (Bill McCarthy)
- Newsgroups: comp.lang.c
- Subject: Re: Leap Years
- Date: 11 Feb 1996 17:10:51 GMT
- Organization: News & Observer Public Access
- Message-ID: <4fl7ur$nsb@castle.nando.net>
- References: <8BA8405.02C70020E1.uuout@sourcebbs.com>
- Reply-To: actuary@nando.net (Bill McCarthy)
- NNTP-Posting-Host: grail519.nando.net
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <8BA8405.02C70020E1.uuout@sourcebbs.com>,
- david.mohorn@sourcebbs.com (DAVID MOHORN) writes:
-
- >How do you feature out leap years?
-
- Huh?
-
- >If its evenly divisible by 400 and 4?
-
- Obviously not. 1996 is a leap year and is certainly not "evenly divisible"
- by 400.
-
- Here's a macro to make that determination:
-
- #define LeapYear( yr ) (!((int)(yr) & 3) && ((yr) % 100 || !((yr) % 400)))
-
- Bill McCarthy
- actuary@nando.net
- Wendell, NC USA
-
-